package com.krediti.session;

import java.util.ArrayList;
import java.util.List;

import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityHome;

import com.krediti.entity.Korisnik;
import com.krediti.entity.KreditniZahtev;

@Name("korisnikHome")
public class KorisnikHome extends EntityHome<Korisnik> {

	/**
	 * Generated serial version.
	 */
	private static final long serialVersionUID = 1L;
	private String jmbg = null;

	public String getJmbg() {
		return jmbg;
	}

	public void setJmbg(String jmbg) {
		this.jmbg = jmbg;
	}

	public void setKorisnikId(Integer id) {
		setId(id);
	}

	public Integer getKorisnikId() {
		return (Integer) getId();
	}

	@Override
	protected Korisnik createInstance() {
		Korisnik korisnik = new Korisnik();
		return korisnik;
	}

	public void wire() {
		getInstance();
	}

	public boolean isWired() {
		return true;
	}

	public Korisnik getDefinedInstance() {
		return isIdDefined() ? getInstance() : null;
	}

	public List<KreditniZahtev> getKreditniZahtev() {
		return getInstance() == null ? null : new ArrayList<KreditniZahtev>(
				getInstance().getKreditniZahtev());
	}

}
